package com.eastmoney.emis.edda.infrastructure.fund;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.infrastructure.fund
 * @author: 汪程程
 * @date: 2022/10/19 3:59 PM
 * @version: 1.0
 */
public enum FundDepositStatus {
    SUCCESS(0),
    // 请求已执行成功 - 恒生的
    SUCCESS_ALREADY(850286),

    // 生效日期不能早于币种开户日期
    VALUE_DATE_EARLY_OPEN_ACCOUNT(200685),

    UNKNOWN(-1);


    private Integer code;

    FundDepositStatus(Integer code) {
        this.code = code;
    }

    private static final FundDepositStatus[] FUND_DEPOSIT_STATUSES = FundDepositStatus.values();

    public static FundDepositStatus parse(Integer code) {
        for (FundDepositStatus fundDepositStatus : FUND_DEPOSIT_STATUSES) {
            if (fundDepositStatus.code.equals(code)) {
                return fundDepositStatus;
            }
        }
        return FundDepositStatus.UNKNOWN;
    }

}
